#include"process.h"
#include<stdio.h>
#include<unistd.h>
typedef void (*callback)(double total,double current);

double total = 1024;
double speed = 1.0;

void Download(callback cb)
{
    double current = 0;
    while(current<=total)
    {
        cb(total,current);
        usleep(3000);
        current+=speed;
    }

    printf("\nDownload %.2lfMB Down\n",current);
}

void Upload(callback cb)
{
    double current = 0;
    while(current<=total)
    {
        cb(total,current);
        usleep(3000);
        current+=speed;
    }

    printf("\nUpload %.2lfMB Down\n",current);
}
int main()
{
    //process_v1();
    Download(FlushProcess);
    Upload(FlushProcess);
    return 0;

}
